<template>
    <div class="box" id="ad">
        <div class="content">
            <div class="bg">
                <img src="../../assets/bg.png">
            </div>
            <div class="ad close">
                <img @click="close" src="../../assets/close.png">
            </div>
            <div class="ad logo">
                <img src="../../assets/logo.png">
            </div>
            <div class="ad txt">
                <span>打开京东App购物</span>
            </div>
            <div class=" ad open">
                <span>立即打开</span>
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        name: "advertisement", 
        data() {
            return {

            }
        },
        methods: {
            close() {
                this.$store.state.adclosed = true
            }
        }
    }
</script>

<style>
    .content {
        transition: all 0.2s ease;
        height: 50px;
        background-color: #232326;
        width: 100%;
        line-height: 50px;
        position: relative;
        font-size: 0;
        overflow: hidden;
    }

    .isclose {
        height: 0;
    }

    .bg {
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        z-index: 4;
    }

    .bg img {
        width: 100%;
        height: 100%;
    }

    .box {
        width: 100%;
        max-width: 640px;
        min-width: 300px;
        margin: 0 auto;
        font-size: 0;
        top: 0;
        overflow: hidden;
        z-index: 20;
    }

    .ad {
        position: relative;
        z-index: 5;
        float: left;
        overflow: hidden;
    }

    .close {
        width: 16px;
        height: 50px;
        line-height: 50px;
        display: inline-block;
        margin-left: 2.5%;
    }

    .close img {
        position: absolute;
        top: 35%;
        left: 0%;
        width: 100%;
        height: auto;
        cursor: pointer;
    }

    .logo {
        width: 35px;
        height: 50px;
        line-height: 50px;
        margin-left: 5%;
        margin-right: 2.5%;
    }

    .logo img {
        position: absolute;
        top: 16%;
        left: 0%;
        width: 100%;
        height: auto;
    }

    .txt {
        color: #fff;
        text-align: center;
        padding: 0;
        font-size: 13px;
    }

    .open {
        display: inline-block;
        height: 100%;
        width: 31.88%;
        text-align: center;
        right: -21.5%;
        font-size: 15px;
        color: #fff;
    }
</style>